<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title>User Auth</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
  	<link rel="stylesheet" th:href="@{/css/bootstrap/css/bootstrap.min.css}" />
	<link rel="stylesheet" th:href="@{/css/font-awesome/css/font-awesome.min.css}" />
	<link rel="stylesheet" th:href="@{/css/ionicons/css/ionicons.min.css}" />
	<link rel="stylesheet" th:href="@{/css/datatables/css/dataTables.bootstrap.min.css}" />
	<link rel="stylesheet" th:href="@{/css/adminlte/css/adminlte.min.css}" />
	<link rel="stylesheet" th:href="@{/css/skins/_all-skins.min.css}" />

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet"
        href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic" />
	<script th:src="@{/js/jquery/jquery.min.js}"></script>
	<script th:src="@{/js/bootstrap/bootstrap.min.js}"></script>
	<script th:src="@{/js/fastclick/fastclick.js}"></script>
	<script th:src="@{/js/adminlte/adminlte.min.js}"></script>
	<script th:src="@{/js/jquery-slimscroll/jquery.slimscroll.min.js}"></script>
	<script th:src="@{/js/datatables/jquery.dataTables.min.js}"></script>
	<script th:src="@{/js/datatables/dataTables.bootstrap.min.js}"></script>
	<script th:src="@{/js/jquery-slimscroll/jquery.slimscroll.min.js}"></script>
	<script th:src="@{/js/fastclick/fastclick.js}"></script>        
</head>

<body class="hold-transition skin-blue sidebar-mini">
	<div class="wrapper">
		<header class="main-header">
			<!-- Logo -->
			<a href="#" class="logo"> <!-- mini logo for sidebar mini 50x50 pixels -->
				<span class="logo-mini"><b>智能交通管理系统</b></span> <!-- logo for regular state and mobile devices -->
				<span class="logo-lg"><b>智能交通管理系统</b></span>
			</a>

			<!-- Header Navbar: style can be found in header.less -->
			<nav class="navbar navbar-static-top">
				<!-- Sidebar toggle button-->
				<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button"> <span class="sr-only">Toggle navigation</span></a>
				<!-- Navbar Right Menu -->
				<div class="navbar-custom-menu">
					<ul class="nav navbar-nav">

						<!-- Control Sidebar Toggle Button -->
						<!-- Control Sidebar Toggle Button -->
						<li><a th:href="@{/logout}"><i class="glyphicon glyphicon-off"></i></a></li>
					</ul>
				</div>
			</nav>
		</header>
		<!-- Left side column. contains the logo and sidebar -->
		<div th:include="inc/inc_frg::main_menu"></div>

		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<h1>主页</h1>
			</section>

			<!-- Main content -->
			<section class="content">
				<div class="row">
					<div class="col-md-12">
						<div class="box">
							<div class="box-header with-border">
								<h2 style="text-align:center">用户列表</h2>
								<table th:unless="${#lists.isEmpty(users)}" class="table table-bordered table-striped">
									<thead>
										<tr>
											<th>用户名称</th>
											<th>口令</th>
											<th>角色</th>
											<th>动作</th>
										</tr>
									</thead>
									<tbody>
										<tr th:each="user : ${users}">
											<td th:text="${user.username}"></td>
											<td th:text="${user.password}"></td>
											<td th:text="${roles[user.role]}"></td>
											<td>
												<div class="btn-toolbar">
												  <div class="btn-group">
												    <a class="btn" th:href="@{'/user/set_adv?username='+${user.username}}">设为一般管理员</a>
												    <a class="btn" th:href="@{'/user/set_nor?username='+${user.username}}">设为普通用户</a>
												    <a class="btn" th:href="@{'/user/disable?username='+${user.username}}">设为无效用户</a>
												  </div>
												</div>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
					<!-- /.box-footer -->
				</div>
				<!-- /.box -->
				<div></div>
				<!-- /.col -->
				<!-- /.row -->
			</section>
			<!-- /.content -->
			<!-- /.content-wrapper -->
		</div>
		
		<div th:include="inc/inc_frg::main_footer"></div>
		<!-- ./wrapper -->
	</div>
</body>
</html>
